package com.prj.ufdm.file.service;

import java.util.List;

import org.springframework.data.mongodb.gridfs.GridFsResource;
import org.springframework.web.multipart.MultipartFile;

import com.prj.ufdm.file.model.AloneFile;

public interface AloneFileService {

    /**
     * DESC: 保存文件
     * @param file
     * @param aloneFile 
     * @return
     * @throws Exception
     */
    public AloneFile saveAloneFile(MultipartFile file,AloneFile aloneFile) throws Exception;
    
    /**
     * DESC: 根据HASH值获取文件
     * @param fileHash
     * @return
     * @throws Exception
     */
    public AloneFile getAloneFileByFileHash(String fileHash)  throws Exception;
    
    /**
     * DESC: 根据 wholeFileId 值获取所有文件
     * @param wholeFileId
     * @return
     * @throws Exception
     */
    public List<GridFsResource> getAllGridFsResourceByWholeFileId(String wholeFileId) throws Exception;
    
    /**
     * DESC: 根据 wholeFileHash 值获取所有文件
     * @param wholeFileHash
     * @return
     * @throws Exception
     */
    public List<GridFsResource> getAllGridFsResourceByWholeFileHash(String wholeFileHash) throws Exception;
    
}
